package com.efuture.springbootcondition.config;

import com.efuture.springbootcondition.condition.MyConditional;
import com.efuture.springbootcondition.condition.SelfConditionClass;
import com.efuture.springbootcondition.domain.User;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

/**
 * @description: TODO
 * @author: zhaoshanshan
 * @create: 2021-10-31 19:15
 **/
@Configuration
public class UserConfig {
    @Bean
    @SelfConditionClass("redis.clients.jedis.Jedis")
    public User user(){
        return new User();
    }

    @Bean
    @ConditionalOnProperty(name = "efuture",havingValue="zhaoshanshan")
    public User user2(){
        return new User();
    }


}
